import request from '@/utils/request'

export const artGetChannelsService = () => {
  return request.get('/my/cate/list')
}

export const artAddChannelsService = ({ cate_name, cate_alias }) => {
  request.post('/my/cate/add', { cate_name, cate_alias })
}

export const artEditChannelService = ({ id, cate_name, cate_alias }) => {
  request.put('/my/cate/info', { id, cate_name, cate_alias })
}

export const artDelChannelService = (id) => {
  request.delete('/my/cate/del', {
    params: { id }
  })
}

export const artGetListService = (params) => {
  return request.get('/my/article/list', { params })
}

export const artPublishService = (data) => {
  request.post('/my/article/add', data)
}

export const artDelArticleService = (id) => {
  return request.delete('/my/article/info', {
    params: { id }
  })
}

// 获取文章详细内容
export const artGetDetailService = (id) =>
  request.get('/my/article/info', {
    params: {
      id
    }
  })
// 文章编辑接口
export const artEditService = (data) => request.put('my/article/info', data)
